package com.xc.pattern.command;

/**
 * @author xingchen
 * @description
 * @create 2022-09-07 20:47
 */
public class OffCommand implements Command {


    /**
     * 对哪个receiver进行命令处理
     */
    private ConditionReceiver receiver;

    public OffCommand(ConditionReceiver receiver) {
        this.receiver = receiver;
    }

    /**
     * 必须实现一个命令的调用
     */
    @Override
    public void execute() {
        System.out.println("OffCommand -> execute");
        receiver.off();
    }
}
